#ifndef CmdNo_First
#define CmdNo_First
#ifdef __GNUG__
#pragma interface
#endif

//---- IdRange -----------------------------------------------------------------

class IdRange {
public:
	IdRange();
	IdRange(int length);
	IdRange(int start, int length);
	int operator ()() const;
	int First() const;
	int Contains(int id) const;
	int Last() const;
	int Length() const;
protected:
	static int NextRange;
	int start, length;
};

inline int IdRange::operator ()() const
	{ return start; }
inline int IdRange::First() const
	{ return start; }
inline int IdRange::Contains(int id) const
	{ return (id >= start && id < start+length); }
inline int IdRange::Last() const
	{ return start+length-1; }
inline int IdRange::Length() const
	{ return length; }

extern const IdRange gStdId;

//---- standard command codes --------------------------------------------------

const int
	cUNDO         =   1,
	cSAVE         =   2,
	cLOAD         =   3,
	cPRINT        =   4,
	cCLOSE        =   5,
	cQUIT         =   6,
	cINSPECT      =   7,
	cMOVE         =   8,
	cSTRETCH      =   9,
	cTOP          =  10,
	cBOTTOM       =  11,
	cREDISPLAY    =  12,
	cCOLLAPSE     =  13,
	cCUT          =  14,
	cCOPY         =  15,
	cPASTE        =  16,
	cLASTEDIT     =  cPASTE,
	cTYPEING      =  17,
	cSELECTALL    =  18,
	cACCEPT       =  19,
	cNEW          =  20,
	cNEWLAST      =  29,
	cDEBUGFIRST   =  30,
	cDEBUGLAST    =  39,
	cABOUT        =  40,
	cOPEN         =  41,
	cSAVEAS       =  42,
	cREVERT       =  43,
	cFIND         =  44,
	cSHOWAPPLWIN  =  45,
	cIMPORT       =  46,
	cSETPAGE      =  55,
	cCHANGEALL    =  56,
	cCHOOSEPRINTER=  57,
	cREDO         =  58,
	cZOOMOUT      =  59,
	cZOOMIN       =  60,
	cZOOMRESET    =  61,
	cFINDAGAIN    =  62,
	cHELP         =  63,
		
// standard menus
	cHELPMENU     =  80,
	cEDITMENU     =  81,
	cAPPMENU      =  82,
	cTOOLMENU     =  83,
	cFILEMENU     =  88,
	cSIZEMENU     =  89,
	cFONTMENU     =  90,
	cSTYLEMENU    =  91,
	cFORMATMENU   =  92,
	cVIEWMENU     =  93,
	cMANAGERMENU  =  94,
	cSHELLMENU    =  95,
				
// ....
// source code browser
	cEDITOTHER        = 100,
	cEDITSUPER        = 101,
	cEDITSELECTED     = 102,
	cSHOWHIERARCHY    = 103,
	cSHOWINHPATH      = 104,
	cGOBACK           = 105,
	cGOTOLINE         = 106,
	cSPAWN            = 107,
	cREFORMAT         = 108,
	cUTILMENU         = 109,
	cINSPECTSOME      = 110,
	cSHOWIMPLEMENTORS = 112,
	//  ShellTextView
	cDOIT             = 200,
	cBECOMECONSOLE    = 201,
	cCLEAR            = 202,
	cRECONNECT        = 203,
	cAUTOREVEAL       = 204,

	cINCSIZE        = 300,
	cDECSIZE        = 301,
	cTEXTSPACING    = 331,
	cFIRSTSPACING   = 340,
	cLASTSPACING    = 380,

	// character properties
	cFIRSTFONT      = 400  +   1,
	cLASTFONT       = cFIRSTFONT+ 100,
	cFIRSTSIZE      = cLASTFONT +   1,
	cLASTSIZE       = cFIRSTSIZE+ 100,
	cFIRSTFACE      = cLASTSIZE +   1,
	cLASTFACE       = cFIRSTFACE+ 100,
	cFIRSTCOLOR     = cLASTFACE +   1,
	cLASTCOLOR      = cFIRSTCOLOR+ 100,
	cCOLORMENU      = cLASTCOLOR+   1,
	cCOLOROTHER     = cLASTCOLOR+   2,
	cCHARLAST       = cCOLOROTHER,
	
	// format
	cFIRSTADJUST    = cCHARLAST +   1,
	cLASTADJUST     = cFIRSTADJUST+10,
	cCOPYPARA       = cLASTADJUST+  1,
	cAPPLYPARA      = cLASTADJUST+  2,
	cPARAPROP       = cLASTADJUST+  3,
	cRTFVOBJ        = cLASTADJUST+  4,
	cFORMATLAST     = cRTFVOBJ,
			
	// view
	cSHOWRULER      = cFORMATLAST+  1,
	cSHOWINVIS      = cFORMATLAST+  2,
	cDOUBLEBUF      = cFORMATLAST+  3,

	cUSERCMD        = 1000;

//---- standard dialog item id's -----------------------------------------------
//     for Control and DownControl

const int
	// cIdNone        = -1,   in Object.h
	cIdOk             = 1,
	cIdYes            = 2,
	cIdNo             = 3,
	cIdCancel         = 4,
	cIdUp             = 5,
	cIdDown           = 6,
	cIdLeft           = 7,
	cIdRight          = 8,
	cIdDefault        = 9,
	cIdIgnore         = 10,
	cIdAbort          = 11,
	cIdInspect        = 12,
	cIdTrace          = 13,
	cIdApply          = 14,
	cIdShowProperties = 15,
	//...
	cIdFirstUser      = 1000;

//---- standard part codes -----------------------------------------------------
//     for Control and DownControl

const int
	cPartChangedText      = 2,
	cPartIncr             = 4,
	cPartDecr             = 5,
	cPartAction           = 8,
	cPartValidate         = 9,
	cPartCollSelect       = 10,
	cPartCollDoubleSelect = 11,
	cPartScrollStep       = 12,
	cPartScrollPage       = 13,
	cPartScrollAbs        = 14,
	cPartScrollHAbs       = 15,
	cPartScrollVAbs       = 16,
	cPartScrollRel        = 17,
	cPartScrollPos        = 18,
	cPartViewSize         = 19,
	cPartToggle           = 20,
	cPartOriginChanged    = 21,
	cPartExtentChanged    = 22,
	cPartEnableLayoutCntl = 23,
	cPartTreeSelect       = 24,
	cPartTreeDoubleSelect = 25,
	cPartSenderDied       = 26,
	// cPartAnyChange     = 27,   in Object.h
	cPartReplacedText     = 28,
	cPartChangeSplit      = 32,
	cPartSelectionChanged = 33,
	cPartCommandDone      = 34,
	cPartCharStyleChanged = 35,
	cPartCharStyleRepl    = 36,
	cPartValueChanged     = 37,
	// reserved
	cPartLast             = 100,
	// ...
	cPartFirstUser        = 1000;

#endif
